import method
import rsa
import base64

RSAMethod = method.RSAMethod()
rsaPubKey = RSAMethod.Pub_strToKey("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2EnR9nsvvWJjmfsZH4olSpSO4wAzuGA5ALg+t9ewoWaqI14j8Sw7WA/mSUZhN/8MJJ294mGeCArTitcCOFP9plTxBDsjRXaESNfXuxrHLWrcL7C1uiFCZXt5FMBRDXKrYj4AKKzzw+DcgJ5HaHruC8QTRYxK8bQkVoE5GMFGwQwIDAQAB")
# print(rsaKey)
# rsaPriKey = RSAMethod.Pri_strToKey()


string = b"20041123"
enStr = rsa.encrypt(string, rsaPubKey)
crypto_msg = base64.b64encode(enStr).decode('utf-8')
# print(crypto_msg)
# print()

msg = base64.b64decode(crypto_msg)

# rsa.PublicKey()
# rsa.decrypt(msg, rsa.PrivateKey())

# print(msg)